I wrote a new essay about what I believe is the best language for beginning . As not unusual, the final conclusion is not as important as the insights along the way. There are still some parts of it that I now find sub-optimal (especially the description on Perl), but I prefered to Release Early and Often.
Also see the Coverage on the web, with some comments by other people.
Re:Best introductory language
Shlomi Fish on 2007-04-22T06:54:51
I mostly agree with your post here. As for BASIC - while I have studied it back in 1987, I believe it's no longer adequate for today's world, where the state of the art and the demands from a clueful programmer are much greater today. I'm not saying it's such a bad language to start from, just that you might as well do yourself a favour and start learning Perl.
As you know there are many kids out there who start by learning HTML, and then gradually learn either JavaScript or PHP. Or alternatively learn Perl (or whatever) to write CGI scripts, IRC bots, etc. Thus, they gradually become better and better programmers.
I suppose that's not such a bad way to learn. Probably better than someone with no knowledge of programming enrolling to CS/SE/etc. in university and expecting it to teach him how to become a programmer.
Re:Best introductory language
drhyde on 2007-04-23T09:33:08
Now, I freely confess that I haven't looked at any modern BASICs, but my own experience of using them leads me to think that they are not suitable for use as pedagogical tools these days. It was far too easy to write spaghetti and crucially, it lacked lots of important concepts like user-defined functions and scoping.I do agree that C is too low-level to get started with, although I disagree that people should start with a high level of abstraction and work their way down. I say start with Javascript, which is nicely structured and immediately usable by the students. Then introduce them to an assembler. 6809 or Z80 - something small and simple where they have to think about fundamental operations like multiplication, but without the confusion of privelege levels, out-of-order execution and the like. I firmly believe that you can't program well without knowing how the machine works, and you can't learn that without studying assembly programming. Then I'd move them on to something like perl or python - don't bother with C, as it's really just a glorified portable assembler and only differs from true assembler in its syntax, but do cover the C toolchain.
Re:Best introductory language
Shlomi Fish on 2007-04-23T13:20:18
Now, I freely confess that I haven't looked at any modern BASICs, but my own experience of using them leads me to think that they are not suitable for use as pedagogical tools these days. It was far too easy to write spaghetti and crucially, it lacked lots of important concepts like user-defined functions and scoping.Well, some modern BASICs may be better than the old XT ROM BASIC or GW-BASIC or the BASICs that preceded it. It was indeed too easy to write such goto-infested code there, but when I learned it, I was taught to think in terms of conditionals and loops, while still using GOTOs.
I no longer recommend starting with BASIC, because it no longer supports most modern paradigms which Perl 5 and other modern languages do. In my day and age, any BASIC, DOS and Assembler programmer was considered a hacker. Nowadays, you need to know Unix (Linux/BSD/etc.), shell, Perl (and/or one of its alternatives), ANSI C, Lisp and more to be worth your salt.
I do agree that C is too low-level to get started with, although I disagree that people should start with a high level of abstraction and work their way down.
I say start with Javascript, which is nicely structured and immediately usable by the students.
I believe people should start with XHTML, learning it according to the HTML+CSS standards. HTML Dog is a the best tutorial I saw about it.
However, learning JavaScript afterwards is problematic because JavaScript is too quirky, does not work the same in all browsers, has prototype-based OOP instead of a more conventional class-based OOP, is a domain-specific language, and also in many cases tends to be more verbose and less elegant than Perl, Python or Ruby.
So Perl should be taught instead.
Then introduce them to an assembler. 6809 or Z80 - something small and simple where they have to think about fundamental operations like multiplication, but without the confusion of privelege levels, out-of-order execution and the like. I firmly believe that you can't program well without knowing how the machine works, and you can't learn that without studying assembly programming.
Assembler should be taught after Perl and Python as I've shown in the article. Furthermore it should be taught after C. C is a useful stepping stone to Assembler, is a very useful language, and by learning it one is much better prepared for Assembler, thinks about the machine in a better way, and is more aware of it. You need to swim a few pools, before you attempt to swim across the British Channel, and so you should learn C before learning Assembler.
Then I'd move them on to something like perl or python - don't bother with C, as it's really just a glorified portable assembler and only differs from true assembler in its syntax, but do cover the C toolchain.C is more than a glorified portable assembler. Knowing it is essential to knowing how portable code is written, how Unix behaves, how almost all virtual machines (perl5, python, php, the JVM, Parrot, ruby, io, lua, you name it) are implemented and how to write code that is usable everywhere. It's also very useful as a lot of code , some of which extremely important is written in ANSI C or C++.
I've written a little about it on my site. Many people seem to believe C is redundant, but that's not the case. C still has its uses, and should be taught, and before assembler.